import Vue from 'vue'
import Cookies from 'js-cookie'
import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import i18n from './i18n/index'

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control
import util from './utils/util'
import checkBtnPermission from '@/utils/btnPermission'
// 表格穿梭框
import eltTransfer from 'ex-elt-transfer'
/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */
// if (process.env.NODE_ENV === 'production') {
//   const { mockXHR } = require('../mock')
//   mockXHR()
// }

Vue.prototype.$util = util
Vue.prototype.$checkBtnPermission = checkBtnPermission

// set ElementUI lang to EN
Vue.use(Element, {
  size: Cookies.get('size') || 'small',
  i18n: (key, value) => i18n.t(key, value)
})
Vue.use(eltTransfer)
Vue.config.productionTip = false

new Vue({
  el: '#app',
  i18n,
  router,
  store,
  render: h => h(App)
})
